package conterlles

import (
	"exam12_11/models/mysql"
	"github.com/gin-gonic/gin"
	"net/http"
)

func FindUser(c *gin.Context) {
	tel := c.PostForm("tel")
	findUser := mysql.FindUser(tel)
	if findUser.ID == 0 {
		c.JSON(http.StatusOK, JsonRes{
			Code:    500,
			Message: "该用户不存在",
			Data:    nil,
		})
		return
	}
	c.JSON(http.StatusOK, JsonRes{
		Code:    200,
		Message: "查找成功",
		Data:    findUser,
	})
}
